: Gerard O'Rourke
: Michael Brophy
:
: Convert Ulaw Files to Alaw
: Note will overwrite existing files to take a backup!
: Version 1.0


echo *********************************
echo ULAW to ALAW Bulk File conversion
echo *********************************
echo.
echo For technical issues with this application please
echo email Gerry O'Rourke at: gorourke@eircom.ie
echo Many thanks for Mike Brophy for assitance in this simple little app.
echo.
echo This application will overwrite existing ulaw wav files in the current and all sub folders.
echo TAKE A BACKUP of all files BEFORE running this app.
echo.
echo Requirements: 
echo The original audio files should be in 16 bit 8000Khz format and end in .wav
echo The sox.exe must be located in the current folder or on the OS path list.
echo.
echo.
echo ******************************************************************
echo. 
set /P confirm=Do you want to proceed and OVERWRITE and convert existing.wav files from ulaw to alaw(Y/N)?

IF "%confirm%" == "Y" goto convert
IF "%confirm%" == "y" goto convert
goto noconvert


:convert
echo Converting files now.
echo please wait.....
echo.
FOR /R . %%i IN ("*.wav") DO (
sox "%%i" -r 8000 -A -b -c 1 "%%~pni-temp.wav"
move "%%~pni-temp.wav" "%%~pni.wav"
)

pause
 
:noconvert
echo - No converation took place
pause

